<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:util="http://java.sun.com/jsf/composite/util">
	<ui:composition template="/views/layouts/main.xhtml">
	<ui:define name="content">
		<h:form id="formPrincipal">
			<div class="grid_18">
				<div class="grid_6">
					<util:home action="#{aprovacaoClientePortalBean.goHome}" />
				</div>
				<util:titulo value="#{i18n.TituloAprovacaoClientePortal}" />
				<div class="grid_1">
					<util:help />
				</div>
			</div>
			
			<div class="grid_18">
				<p:messages />
			</div>
			
			<div class="grid_18">
				<br/>
				<p:dataTable widgetVar="dataTableAprovacaoClientePortal" 
							id="dataTableAprovacaoClientePortal" 
							paginator="true" paginatorPosition="bottom"
							value="#{aprovacaoClientePortalBean.clientePortalList}" 
							rows="#{contextoBean.dataTableRows}" 
							paginatorTemplate="#{contextoBean.paginatorTemplate}"
							rowsPerPageTemplate="#{contextoBean.rowsPerPage}" var="var"
							emptyMessage="#{i18n.NenhumClientePortalEncontrado}">
					<f:facet name="header">
						<div class="grid_7 tituloDataTable">
							Clientes Pendentes
						</div>
						<div class="grid_10" style="padding-left:15px; text-align: right; ">
							<p:commandButton  onclick="dialogoFiltrarClientePortal.show();"
								icon="ui-icon ui-icon-search" value="#{i18n.btn_Filtrar}" style="float:right"/>
						</div>
					</f:facet>
					<p:column headerText="#{i18n.AprovacaoClientePortal_NomeCompleto}" sortBy="#{var.nomeCompleto}">  
			            <h:outputText value="#{var.nomeCompleto}" />  
			        </p:column>
			        <p:column headerText="#{i18n.AprovacaoClientePortal_DataCadastro}" sortBy="#{var.dataCadastro}">   
			            <h:outputText value="#{var.dataCadastro}" >
			            	<f:convertDateTime pattern="dd/MM/yyyy HH:mm" />
			            </h:outputText>  
			        </p:column>
			        <p:column headerText="#{i18n.AprovacaoClientePortal_Acoes}" style="width:20px;">  
			        	<p:commandButton id="btnAcao" value="..." type="button" icon="ui-icon ui-icon-gear" style="float:right;" />
						<p:menu overlay="true" position="dynamic" trigger="btnAcao" my="left top" at="left bottom">
							<p:menuitem action="#{aprovacaoClientePortalBean.goSelecionar(var.id)}"
								onstart="spinner.show()" oncomplete="spinner.hide(); dialogoDetalharClientePortal.show();"  
								icon="ui-icon ui-icon-radio-off" value="#{i18n.btn_Detalhar}" update=":formDetalharClientePortal, :formConfirmarAprovacao"/>
							<p:menuitem action="#{aprovacaoClientePortalBean.goSelecionar(var.id)}" 
								onstart="spinner.show()" oncomplete="spinner.hide(); dialogoConfirmarAprovacao.show();" 
								icon="ui-icon ui-icon-check" value="#{i18n.btn_Aprovar}" update=":formConfirmarAprovacao"/>
						</p:menu>
			        </p:column> 
				</p:dataTable>
			</div>
		</h:form>
		<ui:include src="/views/aprovacaoClientePortal/_dialogos.xhtml" />
	</ui:define>
	</ui:composition>
</f:view>